package com.mjfeed.controller.admin;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.mjfeed.controller.BaseController;
import com.mjfeed.entity.AdminLog;
import com.mjfeed.service.AdminLogService;
import com.mjfeed.util.Format;
import com.mjfeed.util.Pagination;
import com.mjfeed.util.ParamBean;

/**
 * @description 管理日志 
 * @author zhaominglei
 * @date 2014年10月30日
 */
@Controller("adminAdminLogController")
@RequestMapping("/admin/adminLog")
public class AdminLogController extends BaseController {
	@Resource(name="adminLogService")
	private AdminLogService adminLogService;
	
	@RequestMapping(value = "/list", method=RequestMethod.GET)
	public String list(ParamBean paramBean, HttpServletRequest request, HttpServletResponse response, Model model){
		paramBean.setUrl(getBasePath(request) + "admin/adminLog/list.shtml");
		int p = (Format.null2Zero(request.getParameter("p")) == 0) ? 1 : Format.null2Zero(request.getParameter("p"));
		paramBean.setPage(p);
		Pagination<AdminLog> pagination = adminLogService.getPagination(paramBean);
		request.setAttribute("pagination", pagination);
		return "admin/adminLog/list";
	}
	
}
